import redis

class MyRedis:

    def __init__(self, **redis_kwargs):
        self.__db = redis.Redis(**redis_kwargs)

    def set(self, key, value):
        self.__db.set(key, value)

    def get(self, key):
        return self.__db.get(key)

    def inc(self, key):
        self.__db.incrby(key, 1)

    def exp(self, key, time):
        self.__db.expire(key, time)

    def push(self, key, value):
        self.__db.lpush(key, value)

    def lrange(self, key):
        return [i.decode() for i in self.__db.lrange(key, 0, -1)]

    def pop(self, key):
        self.__db.rpop(key)

    def hset(self,name,key,value):
        self.__db.hset(name,key,value)

    def hget(self,name ,key ):
        return self.__db.hget(name,key)
